<%@ page pageEncoding="UTF-8"%>
<!-- 顶部导航条  -->
<div class="header font">
	<div class="content collapse navbar-collapse" >
	  <ul class="nav navbar-nav nav-pills" style="text-align: center;">
	  	<li><a href="/default" class="no-border" style="width: 52px;" onmouseover="$(this).text('首页')" onmouseout="$(this).text('HOME')">HOME</a></li>
	    <li><a href="/item/list" style="width: 87px;" onmouseover="$(this).text('所有商品')" onmouseout="$(this).text('CATEGORY')">CATEGORY</a></li>
	    <li><a href="/seller/shops" style="width: 65px;" onmouseover="$(this).text('个人店铺')" onmouseout="$(this).text('SHOP')">SHOP</a></li>
	    <li><a href="/seller/brands" style="width: 65px;" onmouseover="$(this).text('品牌店铺')" onmouseout="$(this).text('BRAND')">BRAND</a></li>
	    <li><a href="/seller/inseller" style="width: 110px;" onmouseover="$(this).text('老外生活')" onmouseout="$(this).text('IN SELLER')">IN SELLER</a></li>
	    
	  </ul>
	  
	  <ul class="nav navbar-nav navbar-right" style="margin-right: -14px;">
	     <li style="width: 85px;">
	         <a href="javascript:void(0)" class="headeremail" onclick="toPage(this, 'general/advice')">
	            <p onmouseover="$(this).text('MAIL')" onmouseout="$(this).text('邮箱')">邮箱</p>
	         </a>
	     </li>
		 <li style="width: 90px;">
		     <a href="buyer/cart" class="headercart">
		        <p onmouseover="$(this).text('CART')" onmouseout="$(this).text('购物车')">购物车</p>
		     </a>
		 </li>
		 <li style="width: 125px;">
		     <a href="javascript:void(0)" class="headerfav" onclick="toPage(this, 'buyer/favorite')">
		        <p onmouseover="$(this).text('FAVOURITE')" onmouseout="$(this).text('收藏夹')">收藏夹</p>
		     </a>
		 </li>
	    <c:choose>
			<c:when test="${not empty USER_SESSION.userInfo.id }">
				<%-- <li class="dropdown">
				    <span class="userInfoIcon"></span>
					<a href="javascript:void(0)" onclick="checkIfAudit()" class="user-info"> ${USER_SESSION.userInfo.userName }</a>
					<ul class="dropdown-menu">
						<li><a href="invalidate">EXIT</a></li>
					</ul>
				</li> --%>
				<li class="dropdown">
				    <span class="userInfoIcon" ></span>
					<a href="javascript:void(0)" onclick="checkIfAudit()" class="user-info"> ${USER_SESSION.userInfo.userName }</a>
					<ul id="auditinfo" class="dropdown-menu" style="display:none;">
						<li><p style="font-size: 12px;width: 165px;padding: 5px;">YOUR STORE INFO IS IN AUDIT! </p></li>
					</ul>
				</li>
				<li style="border-left: 2px solid #FFF;width: 90px;">
				     <img src="static/images/global/exit.png" style="margin-left: 10px;width: 20px;"/>
				     <a href="invalidate" style="margin: -26px 0 0 28px;" id="exit-txt" onmouseover="$(this).text('EXIT')" onmouseout="$(this).text('退出')">退出</a>
				</li>
			</c:when>
			<c:otherwise>
	    		<li>
	    		   <a class="headerSignIn" href="javascript:void(0)" onclick="doAction('login')">
	    		      <span class="userInfoIcon"></span>
	    		      <p style="margin-left: 30px;" onmouseover="$(this).text('SIGN IN')" onmouseout="$(this).text('登陆')">登陆</p>
	    		   </a>
	    		</li>
	    		<li style="border-left: 2px solid #FFF;padding-left: 10px;width: 100px;">
	    		   <a href="javascript:void(0)" class="headeregist" onclick="doAction('register')">
	    		      <p onmouseover="$(this).text('REGISTER')" onmouseout="$(this).text('注册')">注册</p>
	    		   </a>
	    		</li>
			</c:otherwise>
		</c:choose>
         
	  </ul>
	</div>
</div>
<form id="_headerSubmitForm" class="" action="" method="post" ></form>
<!-- 顶部导航条结束  -->
<script type="text/javascript">
function toPage(target, url){
	checkLogin(function(){
		window.location.href= url;
	});
}
function checkIfAudit(){
	$("#_headerSubmitForm").goAjax({
		url:"seller/store/checkIfAudit",
		type: "POST",
		semantic:false,
		dataType: "json",
		data:{},
		success: function(jsonData) {
			if(true == jsonData.success){
				if("audit"==jsonData.message){
					//art.dialog({title:"WARRING", icon: "error", content: "YOUR STORE INFO IS IN AUDIT! "});
					$("#auditinfo").show();
					return;
				}
				
				window.location.href="seller/store"
			} else {
				window.location.href="buyer/information"
			}
		}
	});
}

function doAction(actionName){
	art.dialog.open(actionName+"?usePanel=true", {
		title: 'login'==actionName?"SIGN IN 登陆":"REGISTER 注册", close: function(){
			var bRefresh = art.dialog.data("refresh.now");
			if("true" == bRefresh){
				window.location.reload();
			}else if("seller" == bRefresh){
				window.location="seller/store";
			}
		},
		lock: true, id: "actionPanelDialog", top: '15%'
	}, false);
}
</script>